#include "HWInterface.hpp"
#include "CTrace.hpp"
#include <sys/timeb.h>

void HwTimerStart(unsigned long long int microseconds)
{
   TRC_DEBUG("HARDWARE INTERFACE: HwTimer was started. microseconds = %lu", microseconds);
}

void HwTimerStop(void)
{
   TRC_DEBUG("HARDWARE INTERFACE: HwTimer was stopped");
}

unsigned int GetMilliseconds(void)
{
   TRC_DEBUG("HARDWARE INTERFACE: GetMilliseconds() was called");
   return 0xFFFFFFFF;
}

unsigned long long int GetMicroSeconds(void)
{
   timeb tb;
   ftime(&tb);
   unsigned long long int nCount = tb.millitm + (tb.time & 0xfffff)/* * 1000*/;
   
   TRC_DEBUG("HARDWARE INTERFACE: GetMicroSeconds() was called. microseconds=%u", nCount);

   return nCount;
}
